from pydantic import BaseModel
from typing import List, Optional

class Node(BaseModel):
    id: str
    labels: List[str]
    properties: dict

class NodeRelation(BaseModel):
    source: Node
    target: Node
    type: str
    properties: dict

class NodeWithRelations(BaseModel):
    node: Node
    incoming_relations: List[NodeRelation]
    outgoing_relations: List[NodeRelation]

class UpdateNodeRequest(BaseModel):
    node_id: str
    properties: dict